<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="author" content="">

    <!--TODO test,之后删除-->
    <title>管理员注册 - test 禁止开放</title>

    <!--&lt;!&ndash; Bootstrap Core CSS &ndash;&gt;-->
    <!--<link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">-->

    <!--&lt;!&ndash; MetisMenu CSS &ndash;&gt;-->
    <!--<link href="/vendor/metisMenu/metisMenu.min.css" rel="stylesheet">-->

    <!--&lt;!&ndash; Custom CSS &ndash;&gt;-->
    <!--<link href="/dist/css/sb-admin-2.css" rel="stylesheet">-->

    <!--&lt;!&ndash; Custom Fonts &ndash;&gt;-->
    <!--<link href="/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">-->


    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>

    <!-- jQuery -->
    <script src="/static/bootstrap3/js/jquery-1.11.2.min.js"></script>

    <!--&lt;!&ndash; Bootstrap Core JavaScript &ndash;&gt;-->
    <!--<script src="/vendor/bootstrap/js/bootstrap.min.js"></script>-->

    <!--&lt;!&ndash; Metis Menu Plugin JavaScript &ndash;&gt;-->
    <!--<script src="/vendor/metisMenu/metisMenu.min.js"></script>-->

    <!--&lt;!&ndash; Custom Theme JavaScript &ndash;&gt;-->
    <!--<script src="/dist/js/sb-admin-2.js"></script>-->
    <!--<![endif]&ndash;&gt;-->

</head>

<body>

<div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <div class="login-panel panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">管理员注册页面(test测试模式 禁止开放)</h3>
                </div>
                <div class="panel-body">
                    <form role="form" id="loginForm" method="post">
                        <fieldset>
                            <div class="form-group">
                                <input class="form-control" placeholder="用户名" id="uname" name="name" type="text"
                                       autofocus>
                            </div>
                            <div class="form-group">
                                <input class="form-control" placeholder="姓名实名" id="truename" name="truename" type="text"
                                       autofocus>
                            </div>
                            <div class="form-group">
                                <input class="form-control" placeholder="密码" id="password" name="password" type="text"
                                >
                            </div>
                            <!-- Change this to a button or input when using this as a form -->
                            <input type="button" id="regBtn" class="btn btn-lg btn-success btn-block" value="注册">
                            </input>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!--大屏幕上右键datagrid dlg-->
<div id="grid-data" class="easyui-menu" style="width: 80px; display: none;">
    <div id="grid-data-edit" href="javascript:openDetailsModifyDialog()" data-options="iconCls:'icon-edit'">修改</div>
    <div id="grid-data-delete" href="javascript:deleteDetails()" data-options="iconCls:'icon-remove'" plain="true">删除
    </div>
</div>
<!--二级菜单右键弹出-->
<div id="tree-2" class="easyui-menu" style="width: 80px; display: none;">
    <div id="tree-2-delete" href="javascript:deleteType()" data-options="iconCls:'icon-remove'">删除二级菜单</div>
</div>
<!--一级菜单右键弹出-->
<div id="tree-1" class="easyui-menu" style="width: 80px; display: none;">
    <div id="tree-1-add-2" href="javascript:openTypeAddDialog()" data-options="iconCls:'icon-add'">添加二级菜单</div>
    <div id="tree-1-delete" href="javascript:deleteType()" data-options="iconCls:'icon-remove'">删除一级菜单</div>
</div>
<!--树形菜单右键弹出-->
<div id="tree-0" class="easyui-menu" style="width: 80px; display: none;">
    <div id="tree-0-add-1" href="javascript:openTypeAddDialog(0)" data-options="iconCls:'icon-add'">添加一级菜单</div>
    <div id="tree-0-refresh" href="javascript:reloadTree()" data-options="iconCls:'icon-reload'">重新加载类别</div>
</div>



</body>
<script>
    //禁止整体该页面的右键弹出html相关,不阻碍easyui右键
    $(function () {
        $(document).bind('contextmenu', function (e) {
            e.preventDefault();
            $('#tree-0').menu('show', {
                left: e.pageX,
                top: e.pageY
            });
        });
    });

    $("#regBtn").click(submitAjax);
    function submitAjax(){
        alert("开始注册了ajax")
        $.ajax({
            url:"/admin/user/register",
            data:{"yonghumingcheng":$("#uname").val(),"password":$("#password").val(),"truename":$("#truename").val()},
            type:"post",
            dataType:"json",
            success:function(data){
                if(data.code===1){
                    alert(data.message);
                    // window.location.href = "/";
                }else{
                    alert(data.message);
                }
            }
        })
    }
</script>

</html>
